#ifndef SslSysSimMain_H
#define SslSysSimMain_H

using namespace  System;
using namespace System::Threading;
using namespace  System::Threading::Tasks;



namespace ssl
{
    public delegate void DbgInfo(String^ Msg);
    public ref class  SslProcess
    {
    public:
        static DbgInfo ^SslDbgInfo;
    public:
        int SslMain()
        {
            int result = spt::SslMain();
            return result;
        }
        void SslSampInt()
        {
            ::SslSampInt();
        }
        void Ssl1MsInt()
        {
            ::Ssl1MsInt();
        }
    public:
        int SslSampCntPerCircle()
        {
            return 48;
        }
        Int64  PowerUpTimeMs()
        {
            return spt::PowerUpTimeMs();
        }
        Int64  PowerUpTimeSampNum()
        {
            return spt::PowerUpSampNum();
        }
    public:
       
    private:

        
    private :
        
    };
	


    void WriteLine(const char* Msg)
    {
        if (SslProcess::SslDbgInfo!=nullptr)
        {
            SslProcess::SslDbgInfo(gcnew String(Msg));
        }
    }
}
namespace ssl
{
    public ref class CusTask
    {
    private:
        spt::TaskFuncCallBack cb;
        void* ptr;
    public:
        CusTask(spt::TaskFuncCallBack Cb, void* Ptr) :cb(Cb), ptr(Ptr) {}
        void TaskCallBack()
        {
            cb(ptr);
        }
    public:
        delegate Task^ CreatTask(Action^ action);
        static CreatTask^ creatTask;
    };
    void* StartTask(spt::TaskFuncCallBack Cb, void* Ptr)
    {
        Task^ task = CusTask::creatTask(gcnew Action(gcnew CusTask(Cb, Ptr), &CusTask::TaskCallBack));
        return (void*)(task->Id);
    }
}

#endif 
